// 课程相关API
import axios from 'axios'

// 向外按需导出API--收藏课程
export const getcoursecollection = function (username, coursename) {
  return axios.get('http://localhost:81/hcourse/collectcourse', {
    params: {
      username: username,
      coursename: coursename,
    },
  })
}

// 根据课程名查询课程
export const getCourseByCoursename = function (coursename) {
  return axios.get('http://localhost:81/hcourse/getCourse', {
    params: {
      coursename: coursename,
    },
  })
}

// 根据课程名查询评论
export const getReplyBycoursename = function (coursename) {
  return axios.get('http://localhost:81/hcourse/getReplies', {
    params: {
      coursename: coursename,
    },
  })
}

// 添加评论
export const addReply = function (content, coursename) {
  return axios.post('http://localhost:81/hmathreplyone/addReply', {
    content,
    coursename,
  })
}

// 点击列表切换视频
export const changevideo = function (courseid, coursename) {
  return axios.get('http://localhost:81/highmathone/getByCourseid', {
    params: {
      courseid,
      coursename,
    },
  })
}
